Skip to content

Hotspot map density - #64

Merged
rawcomposition merged 4 commits into
rawcomposition:mainfrom
nleiby:up/hotspot-map-density
Sep 4, 2026
Merged

Hotspot map density#64
rawcomposition merged 4 commits into
rawcomposition:mainfrom
nleiby:up/hotspot-map-density

Conversation

@nleiby

@nleiby nleiby commented Sep 1, 2026

Copy link
Copy Markdown

The hotspot density can get really high in some situations. This PR tries to address this in 2 ways:

  1. scale hotspot marker size by number of checklists at the location
  2. provide a filter on the map view to exclude hotspots with fewer than X observations. At least in the case of Thailand where I have been testing, there are a lot of hotspots with zero observations that error on load.

I'm not convinced that the scaling is exactly right, but I figured I'd share the concept/rough draft with you rather than tune it to my own taste.


Example zero-checklist hotspot with load error:

Screenshot 2026-09-01 at 1 21 21 AM

Current examples of a pretty dense view (Thailand) and a more moderate one (Arizona):

Screenshot 2026-09-01 at 1 02 04 AM Screenshot 2026-09-01 at 1 01 55 AM

Thailand with marker size scaling from this PR:

Screenshot 2026-09-01 at 1 02 37 AM

Thailand after applying a hotspot checklist count filter that is only excluding locations with zero checklists:

Screenshot 2026-09-01 at 1 02 45 AM

Arizona with marker size scaling:

Screenshot 2026-09-01 at 1 11 30 AM

A zoomed view of Thailand before and after scaling/filtering. The difference is less significant with greater zoom.
Screenshot 2026-09-01 at 1 17 08 AM
Screenshot 2026-09-01 at 1 18 39 AM

nickleiby and others added 2 commits August 25, 2026 23:07
Scale hotspot dots by zoom and species count instead of drawing every
one at a fixed size, and add a minimum-checklists filter defaulting to
hotspots with at least one checklist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread frontend/lib/helpers.ts
if (count <= 400) return markerColors[8];
if (count <= 1000) return markerColors[9];
return markerColors[0];
return markerColors[9];

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Counts >1000 were returning markerColors[0], the same as 0 count.

@rawcomposition

Copy link
Copy Markdown
Owner

Cool! I kinda like this idea, actually. I'll play around with it a bit, especially on a mobile device to make sure it still works fine.

@nleiby

nleiby commented Sep 1, 2026

Copy link
Copy Markdown
Author

I hope you don't mind the cluster of PRs- no rush or fast turnaround expected, of course. I'm just thinking about it as I plan a trip! I have a couple more in mind, but I can hold off if you prefer.

I didn't do any mobile device testing. Do you just do in-browser emulation? E.g.:

Screenshot 2026-09-01 at 5 26 13 PM

@rawcomposition

Copy link
Copy Markdown
Owner

I definitely don't mind! Though I'll admit, it may take me a a bit to get to some of the PRs as I stay pretty busy with other work, and also travel a fair bit. So even if a PR sits around for a while, it's certainly not forgotten. For mobile testing, I usually set up my computer so I can access localhost via a mobile device. I forget exactly how I did that, but I'm sure Claude can help!

I do remember several years ago when I was first building out BirdPlan I had to make the dots slightly larger on mobile to make them easier to click on.

@rawcomposition rawcomposition left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this. I made a few tweaks to the UI itself, and also some minor tweaks to the hotspot sizing. We might need to tweak it a bit more in the future, we'll see how it goes.

Image

@rawcomposition
rawcomposition merged commit bc2fd91 into rawcomposition:main Sep 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants